<?php

namespace app\model\system;

use app\model\BaseModel;

/**
 *
 */
class SysDictItem extends BaseModel
{
 
  /**
   * The table associated with the model.
   *
   * @var string
   */
  protected $table = "sys_dict_item";

  public function dict()
  {
    return $this->belongsTo(SysDict::class, 'dictCode', 'id');
  }

  public function getFormArray(): array
  {
    return [
      "id" => $this->id,
      "dictCode" => $this->dictCode,
      "value" => $this->value,
      "label" => $this->label,
      "sort" => $this->sort,
      "status" => $this->status,
      "tagType" => $this->tagType
    ];
  }

  public function toArray(array $merges = []): array
  {
    $modeArray = $this->getFormArray();
    return $this->merge($modeArray, $merges);
  }
}
